﻿using System.Configuration;
using NHibernate;
using Ninject.Modules;
using PCE.Configuration.NH;

namespace PCE.Configuration.IoC.Modules
{
	public class NHModule : NinjectModule
	{
		public override void Load()
		{
			Bind<ISessionFactory>()
				.ToConstant(
					new ConfiguratorBuilder(ConfigurationManager.AppSettings["hhibernate.config-cache-path"])
					.Build()
					.BuildSessionFactory()
				);
		}
	}
}